// 助战使用物品 {"道具":1,"助战编号":1,"角色":"主角"}
// @ts-ignore
export async function execute(client_id, message_json) {
    let index = message_json["助战编号"] - 1;
    let item_index = message_json["道具"] - 1;
    let characters = G.HelpFight.get_help_fight_characters(client_id, index);
    if (characters === undefined) {
        ClientUtils.send_basic_prompt(client_id, "助战角色不存在");
        return;
    }
    if (index === undefined || index < 0) {
        ClientUtils.send_basic_prompt(client_id, "#R数据非法");
        return;
    }
    console.debug(characters["道具"])
    let item = characters["道具"][item_index];
    if (item === undefined || item === null) {
        ClientUtils.send_basic_prompt(client_id, "#助战背包内不存在该物品");
        return;
    }

    if (_ItemHandlerData.has(item["名称"])) {
        await _ItemHandlerData.get(item["名称"]).run(characters, "道具", item_index);
    } else {
        ClientUtils.send_basic_prompt(client_id, "#该物品暂时无法使用");
        return;
    }
    ClientUtils.send_basic_prompt(client_id, "#使用成功");
    G.HelpFight.refrush_help_fight_characters_data(client_id,index);
}